﻿#ifndef XQPUSH_H
#define XQPUSH_H
#include<QString>
#include<QByteArray>
//公共的一些枚举
namespace XQPush
{
	const QByteArray UserTable = "User";//用户表
	namespace Head
	{
		//http字段常量的值
		//const QByteArray AppName = "PushMessage";
		const QByteArray Login = "Login";//登录
		const QByteArray Register = "Register";//注册
		//http字段常量
		const QByteArray App = "App";
		const QByteArray Error = "Error";
		const QByteArray Result = "Result";
		const QByteArray Command = "Command";
		const QByteArray Account = "Account";
		const QByteArray Type = "Type";
	}
	//错误
	enum Error
	{
		NoError,//无错误
		ServerError,//服务器错误
		Timeout,//超时
		TimeNotArrived,//时间未到
		UnknownError,//未知错误
		AccountNotExist,//账户不存在
		PasswordError,//密码错误
	};
	Error toError(const QString& str);
	QByteArray error_toByteArray(Error e);

	//状态
	enum Result
	{
		null,
		AccountLogin,//账号登录
		SendVerify,//验证码发送
	};
	Result toResult(const QString& str);
	QByteArray result_toByteArray(Result result);
};


#endif // !Result_H
